package com.miniprogram.api.mapper;

import com.miniprogram.bean.po.CustomerRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 顾客角色表 Mapper 接口
 * </p>
 *
 * @author lin
 * @since 2020-04-06
 */
public interface CustomerRoleMapper extends BaseMapper<CustomerRole> {

    @Select("select r.* from customer_role r, customer_user_role ur where r.id = ur.rid and ur.uid = #{userId}")
    List<CustomerRole> findByUserId(Integer userId);
}
